USE [JJMC_BPMQA]
GO

/****** Object:  View [dbo].[DDDistributorBasicInfo]    Script Date: 4/15/2020 1:36:10 PM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE VIEW [dbo].[DDDistributorBasicInfo]
AS
SELECT        dbo.formmain_1003.field0001 AS Id, dbo.formmain_1003.field0002 AS ProductType, dbo.formmain_1003.field0004 AS CurrencyType, en1.SHOWVALUE AS CustomerType, dbo.formmain_1003.field0006 AS SIMSID,
                          dbo.formmain_1003.field0007 AS SuperiorDealersName, dbo.formmain_1003.field0008 AS CompanyName, en2.SHOWVALUE AS CooperativeRelationship, dbo.formmain_1003.field0010 AS CompanyFullEnglish, 
                         dbo.formmain_1003.field0011 AS NatureOfTheCompany, en3.SHOWVALUE AS BusinessAddressProvince, en4.SHOWVALUE AS BusinessAddressCity, dbo.formmain_1003.field0014 AS BusinessAddressArea, 
                         dbo.formmain_1003.field0015 AS BusinessAddressCounty, dbo.formmain_1003.field0016 AS FullBusinessAddress, dbo.formmain_1003.field0017 AS CompanyPhone, 
                         dbo.formmain_1003.field0018 AS CompanyFax, dbo.formmain_1003.field0019 AS CompanyEmail, dbo.formmain_1003.field0020 AS CompanyHead, dbo.formmain_1003.field0021 AS CompanyHeadPhone, 
                         dbo.formmain_1003.field0022 AS CompanyHeadLandline, dbo.formmain_1003.field0023 AS CompanyHeadEmail, dbo.formmain_1003.field0024 AS BusinessContacts, 
                         dbo.formmain_1003.field0025 AS BusinessContactsPhone, dbo.formmain_1003.field0026 AS BusinessContactsLandline, dbo.formmain_1003.field0027 AS BusinessContactsEmail, 
                         dbo.formmain_1003.field0028 AS FinancialContacts, dbo.formmain_1003.field0029 AS FinancialContactsPhone, dbo.formmain_1003.field0030 AS FinancialContactsLandline, 
                         dbo.formmain_1003.field0031 AS FinancialContactsEmail, dbo.formmain_1003.field0032 AS IChannelSiteContacts, dbo.formmain_1003.field0033 AS IChannelSiteContactsPhone, 
                         dbo.formmain_1003.field0034 AS IChannelSiteContactsLandline, dbo.formmain_1003.field0035 AS IChannelSiteContactsEmail, dbo.formmain_1003.field0036 AS XiangyunDataLeader, 
                         dbo.formmain_1003.field0037 AS XiangyunDataLeaderPhone, dbo.formmain_1003.field0038 AS XiangyunDataLeaderLandline, dbo.formmain_1003.field0039 AS XiangyunDataLeaderEmail, 
                         dbo.formmain_1003.field0040 AS InvoiceRecipient, dbo.formmain_1003.field0041 AS InvoiceRecipientPhone, dbo.formmain_1003.field0042 AS InvoiceRecipientLandline, 
                         dbo.formmain_1003.field0043 AS InvoiceRecipientEmail, dbo.formmain_1003.field0044 AS InvoiceEmailAddressProvince, dbo.formmain_1003.field0045 AS InvoiceEmailAddressCity, 
                         dbo.formmain_1003.field0046 AS InvoiceEmailAddressArea, dbo.formmain_1003.field0047 AS InvoiceEmailAddressCounty, dbo.formmain_1003.field0048 AS FullInvoiceEmailAddress, 
                         dbo.formmain_1003.field0049 AS InvoiceEmailAddressZipCode, dbo.formmain_1003.field0050 AS InvoiceEmailAddressEmail, dbo.formmain_1003.field0051 AS InvoiceType, 
                         dbo.formmain_1003.field0052 AS InvoiceDepositaryBank, dbo.formmain_1003.field0053 AS InvoiceDepositaryBankAccount, dbo.formmain_1003.field0054 AS InvoiceRegistrationPhone, 
                         dbo.formmain_1003.field0055 AS TaxRegistrationCertificateAddress, dbo.formmain_1003.field0056 AS WhetherThreeCertificates, dbo.formmain_1003.field0057 AS ThreeCertificatesValidity, 
                         dbo.formmain_1003.field0058 AS ThreeCertificatesNumber, dbo.formmain_1003.ThreeCertificatepicFileStream AS ThreeCertificatepicFileStream, dbo.formmain_1003.field0060 AS ThreeCertificatepicpath, 
                         dbo.formmain_1003.field0061 AS LicenseValidity, dbo.formmain_1003.field0062 AS LicenseNumber, dbo.formmain_1003.LicensepicFileStream AS LicensepicFileStream, 
                         dbo.formmain_1003.field0064 AS Licensepicpath, dbo.formmain_1003.field0065 AS OrganizationCCValidity, dbo.formmain_1003.field0066 AS OrganizationCCNumber, 
                         dbo.formmain_1003.OrganizationCCpicFileStream AS OrganizationCCpicFileStream, dbo.formmain_1003.field0068 AS OrganizationCCpicpath, dbo.formmain_1003.field0069 AS TaxRegistrationValidity, 
                         dbo.formmain_1003.field0070 AS TaxRegistrationNumber, dbo.formmain_1003.TaxRegistrationpicFileStream AS TaxRegistrationpicFileStream, dbo.formmain_1003.field0072 AS TaxRegistrationpicpath, 
                         dbo.formmain_1003.field0073 AS MedicalDevicesLicenseValidity, dbo.formmain_1003.field0074 AS MedicalDevicesLicenseNumber, 
                         dbo.formmain_1003.MedicalDevicesLicensepicFileStream AS MedicalDevicesLicensepicFileStream, dbo.formmain_1003.field0076 AS MedicalDevicesLicensepicpath, 
                         dbo.formmain_1003.field0077 AS BiosealValidity, dbo.formmain_1003.field0078 AS BiosealNumber, dbo.formmain_1003.BiosealpicFileStream AS BiosealpicFileStream, 
                         dbo.formmain_1003.field0080 AS Biosealpicpath, dbo.formmain_1003.field0081 AS OrderHandlersPhone, dbo.formmain_1003.field0082 AS OrderHandlersFax, 
                         dbo.formmain_1003.field0083 AS OrderHandlersEmail, dbo.formmain_1003.field0084 AS WAoneProvince, dbo.formmain_1003.field0085 AS WAoneCity, dbo.formmain_1003.field0086 AS WAoneArea, 
                         dbo.formmain_1003.field0087 AS WAoneCounty, dbo.formmain_1003.field0088 AS WAoneAddress, dbo.formmain_1003.field0089 AS WAoneZipCode, dbo.formmain_1003.field0090 AS WAonestponename, 
                         dbo.formmain_1003.field0091 AS WAonestponePhone, dbo.formmain_1003.field0092 AS WAonestponeLandline, dbo.formmain_1003.field0093 AS WAonestptwoname, 
                         dbo.formmain_1003.field0094 AS WAonestptwoPhone, dbo.formmain_1003.field0095 AS WAonestptwoLandline, dbo.formmain_1003.field0096 AS WAtwoProvince, dbo.formmain_1003.field0097 AS WAtwoCity, 
                         dbo.formmain_1003.field0098 AS WAtwoArea, dbo.formmain_1003.field0099 AS WAtwoCounty, dbo.formmain_1003.field0100 AS WAtwoAddress, dbo.formmain_1003.field0101 AS WAtwoZipCode, 
                         dbo.formmain_1003.field0102 AS WAtwostponename, dbo.formmain_1003.field0103 AS WArwostponePhone, dbo.formmain_1003.field0104 AS WAtwostponeLandline, 
                         dbo.formmain_1003.field0105 AS WAtwostptwoname, dbo.formmain_1003.field0106 AS WAtwostptwoPhone, dbo.formmain_1003.field0107 AS WAtwostptwoLandline, 
                         dbo.formmain_1003.field0108 AS ContractManager, dbo.formmain_1003.field0109 AS ContractManagerPhone, dbo.formmain_1003.field0110 AS ContractManagerLandline, 
                         dbo.formmain_1003.field0111 AS ContractManagerEmail
FROM            dbo.formmain_1003 LEFT OUTER JOIN
                         dbo.CTP_ENUM_ITEM AS en1 ON en1.ID = dbo.formmain_1003.field0005 LEFT OUTER JOIN
                         dbo.CTP_ENUM_ITEM AS en2 ON en2.ID = dbo.formmain_1003.field0009 LEFT OUTER JOIN
                         dbo.CTP_ENUM_ITEM AS en3 ON en3.ID = dbo.formmain_1003.field0012 LEFT OUTER JOIN
                         dbo.CTP_ENUM_ITEM AS en4 ON en4.ID = dbo.formmain_1003.field0013

GO

EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[40] 4[20] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "en1"
            Begin Extent = 
               Top = 6
               Left = 273
               Bottom = 136
               Right = 464
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "en2"
            Begin Extent = 
               Top = 138
               Left = 38
               Bottom = 268
               Right = 229
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "en3"
            Begin Extent = 
               Top = 138
               Left = 267
               Bottom = 268
               Right = 458
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "en4"
            Begin Extent = 
               Top = 270
               Left = 38
               Bottom = 400
               Right = 229
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "formmain_1003"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 136
               Right = 235
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      En' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'DDDistributorBasicInfo'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane2', @value=N'd
   End
End
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'DDDistributorBasicInfo'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=2 , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'DDDistributorBasicInfo'
GO

